<!DOCTYPE html>
<html lang="ru">
<head prefix="og: http://ogp.me/ns#">
  <meta charset="utf-8">
  <title>Консоль | Hexo</title>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Canonical links -->
  <link rel="canonical" href="https://hexo.io/ru/api/console.html">
  <!-- Alternative links -->
  
    
      <link rel="alternative" hreflang="en" href="https://hexo.io/api/console.html">
    
      <link rel="alternative" hreflang="zh-tw" href="https://hexo.io/zh-tw/api/console.html">
    
      <link rel="alternative" hreflang="zh-cn" href="https://hexo.io/zh-cn/api/console.html">
    
      <link rel="alternative" hreflang="ru" href="https://hexo.io/ru/api/console.html">
    
      <link rel="alternative" hreflang="ko" href="https://hexo.io/ko/api/console.html">
    
  
  <!-- Icon -->
  <link rel="apple-touch-icon" sizes="57x57" href="/icon/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/icon/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/icon/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/icon/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/icon/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/icon/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/icon/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/icon/apple-touch-icon-152x152.png">
  <link rel="icon" type="image/png" href="/icon/favicon-196x196.png" sizes="196x196">
  <link rel="icon" type="image/png" href="/icon/favicon-160x160.png" sizes="160x160">
  <link rel="icon" type="image/png" href="/icon/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/icon/favicon-16x16.png" sizes="16x16">
  <link rel="icon" type="image/png" href="/icon/favicon-32x32.png" sizes="32x32">
  <meta name="msapplication-TileColor" content="#2f83cd">
  <meta name="msapplication-TileImage" content="/icon/mstile-144x144.png">
  <!-- CSS -->
  <!-- build:css build/css/navy.css -->
  <link rel="stylesheet" href="/css/navy.css">
  <!-- endbuild -->
  <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css">
  <!-- RSS -->
  <link rel="alternate" href="/atom.xml" title="Hexo">
  <!-- Open Graph -->
  <meta name="description" content="Консоль служит для взаимодействия пользователей с Hexo. Регистрирует и описывает доступные консольные команды. Краткий обзорhexo.extend.console.register(name, desc, options, function(args)&amp;#123;  // .">
<meta property="og:type" content="website">
<meta property="og:title" content="Консоль">
<meta property="og:url" content="https://hexo.io/ru/api/console.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Консоль служит для взаимодействия пользователей с Hexo. Регистрирует и описывает доступные консольные команды. Краткий обзорhexo.extend.console.register(name, desc, options, function(args)&amp;#123;  // .">
<meta property="og:locale" content="ru">
<meta property="og:updated_time" content="2017-12-06T21:52:16.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Консоль">
<meta name="twitter:description" content="Консоль служит для взаимодействия пользователей с Hexo. Регистрирует и описывает доступные консольные команды. Краткий обзорhexo.extend.console.register(name, desc, options, function(args)&amp;#123;  // .">
<meta name="twitter:site" content="hexojs">
<meta property="fb:admins" content="100000247608790">
  <!-- Google Analytics -->
  
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-48498357-3', 'auto');
  ga('send', 'pageview');
</script>

</head>

<body>
  <div id="container">
    <header id="header" class="wrapper">
  <div id="header-inner" class="inner">
    <h1 id="logo-wrap">
      <a href="/ru/" id="logo">Hexo</a>
    </h1>
    <nav id="main-nav">
      <a href="/ru/docs/" class="main-nav-link">Docs</a><a href="/ru/api/" class="main-nav-link">API</a><a href="/news/" class="main-nav-link">Новости</a><a href="/plugins/" class="main-nav-link">Плагины</a><a href="/themes/" class="main-nav-link">Темы</a>
      <a href="https://github.com/hexojs/hexo" class="main-nav-link"><i class="fa fa-github-alt"></i></a>
      <div id="search-input-wrap">
        <div id="search-input-icon">
          <i class="fa fa-search"></i>
        </div>
        <input type="search" id="search-input" placeholder="Search...">
      </div>
    </nav>
    <div id="lang-select-wrap">
      <label id="lang-select-label"><i class="fa fa-globe"></i><span>Русский</span></label>
      <select id="lang-select" data-canonical="api/console.html">
        
          <option value="en">English</option>
        
          <option value="zh-tw">正體中文</option>
        
          <option value="zh-cn">简体中文</option>
        
          <option value="ru" selected>Русский</option>
        
          <option value="ko">한국어</option>
        
      </select>
    </div>
    <a id="mobile-nav-toggle">
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
      <span class="mobile-nav-toggle-bar"></span>
    </a>
  </div>
</header>

    <div id="content-wrap">
  <div id="content" class="wrapper">
    <div id="content-inner">
      <article class="article-container" itemscope itemtype="http://schema.org/Article">
        <div class="article-inner">
          <div class="article">
            <div class="inner">
              <header class="article-header">
                <h1 class="article-title" itemprop="name">Консоль</h1>
                <a href="https://github.com/hexojs/site/edit/master/source/ru/api/console.md" class="article-edit-link" title="Предложить улучшение"><i class="fa fa-pencil"></i></a>
              </header>
              <div class="article-content" itemprop="articleBody">
                <p>Консоль служит для взаимодействия пользователей с Hexo. Регистрирует и описывает доступные консольные команды.</p>
<h2 id="Краткий-обзор" class="article-heading"><a href="#Краткий-обзор" class="headerlink" title="Краткий обзор"></a>Краткий обзор<a class="article-anchor" href="#Краткий-обзор" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line">hexo.extend.console.register(name, desc, options, <span class="function"><span class="keyword">function</span>(<span class="params">args</span>)</span>&#123;</span><br><span class="line">  <span class="comment">// ...</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
<table>
<thead>
<tr>
<th>Свойство</th>
<th>Описание</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>Имя</td>
</tr>
<tr>
<td><code>desc</code></td>
<td>Описание</td>
</tr>
<tr>
<td><code>options</code></td>
<td>Опции</td>
</tr>
</tbody>
</table>
<p>Значение из аргумента <code>args</code> передаётся в функцию. Свойство описывает вводимые через терминал данные. Анализируется с помощью <a href="https://github.com/substack/minimist" target="_blank" rel="noopener">Minimist</a>.</p>
<h2 id="Опции" class="article-heading"><a href="#Опции" class="headerlink" title="Опции"></a>Опции<a class="article-anchor" href="#Опции" aria-hidden="true"></a></h2><h3 id="usage" class="article-heading"><a href="#usage" class="headerlink" title="usage"></a>usage<a class="article-anchor" href="#usage" aria-hidden="true"></a></h3><p>Добавление используемых команд в консоль. Например:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">&#123;<span class="attr">usage</span>: <span class="string">'[layout] &lt;title&gt;'</span>&#125;</span><br><span class="line"><span class="comment">// hexo new [layout] &lt;title&gt;</span></span><br></pre></td></tr></table></figure>
<h3 id="arguments" class="article-heading"><a href="#arguments" class="headerlink" title="arguments"></a>arguments<a class="article-anchor" href="#arguments" aria-hidden="true"></a></h3><p>Описание аргументов в консоли. Например:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="built_in">arguments</span>: [</span><br><span class="line">    &#123;<span class="attr">name</span>: <span class="string">'layout'</span>, <span class="attr">desc</span>: <span class="string">'Post layout'</span>&#125;,</span><br><span class="line">    &#123;<span class="attr">name</span>: <span class="string">'title'</span>, <span class="attr">desc</span>: <span class="string">'Post title'</span>&#125;</span><br><span class="line">  ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="options" class="article-heading"><a href="#options" class="headerlink" title="options"></a>options<a class="article-anchor" href="#options" aria-hidden="true"></a></h3><p>Описание опций в консоли. Например:</p>
<figure class="highlight js"><table><tr><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  options: [</span><br><span class="line">    &#123;<span class="attr">name</span>: <span class="string">'-r, --replace'</span>, <span class="attr">desc</span>: <span class="string">'Replace existing files'</span>&#125;</span><br><span class="line">  ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="desc" class="article-heading"><a href="#desc" class="headerlink" title="desc"></a>desc<a class="article-anchor" href="#desc" aria-hidden="true"></a></h3><p>Подробная информация о консольной команде.</p>
<h2 id="Пример" class="article-heading"><a href="#Пример" class="headerlink" title="Пример"></a>Пример<a class="article-anchor" href="#Пример" aria-hidden="true"></a></h2><figure class="highlight js"><table><tr><td class="code"><pre><span class="line">hexo.extend.console.register(<span class="string">'config'</span>, <span class="string">'Display configuration'</span>, <span class="function"><span class="keyword">function</span>(<span class="params">args</span>)</span>&#123;</span><br><span class="line">  <span class="built_in">console</span>.log(hexo.config);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>

              </div>
              <footer class="article-footer">
                <time class="article-footer-updated" datetime="2017-12-06T21:52:16.000Z" itemprop="dateModified">Последнее обновление: 2017-12-06</time>
                <a href="themes.html" class="article-footer-prev" title="Темы"><i class="fa fa-chevron-left"></i><span>Пред</span></a><a href="deployer.html" class="article-footer-next" title="Инструмент размещения"><span>След</span><i class="fa fa-chevron-right"></i></a>
              </footer>
              
<section id="comments">
  <div id="disqus_thread"></div>
</section>
<script>
  var disqus_shortname = 'hexojs';
  var disqus_url = 'https://hexo.io/ru/api/console.html';
  var disqus_title = "Консоль";
  var disqus_config = function(){
    this.language = 'ru';
  };
  (function(){
    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
    dsq.src = 'https://go.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();
</script>

            </div>
          </div>
          <aside id="article-toc" role="navigation">
            <div id="article-toc-inner">
              <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=hexoio" id="_carbonads_js"></script>
              <strong class="sidebar-title">Содержание</strong>
              <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Краткий-обзор"><span class="toc-text"><a href="#&#x41A;&#x440;&#x430;&#x442;&#x43A;&#x438;&#x439;-&#x43E;&#x431;&#x437;&#x43E;&#x440;" class="headerlink" title="&#x41A;&#x440;&#x430;&#x442;&#x43A;&#x438;&#x439; &#x43E;&#x431;&#x437;&#x43E;&#x440;"></a>&#x41A;&#x440;&#x430;&#x442;&#x43A;&#x438;&#x439; &#x43E;&#x431;&#x437;&#x43E;&#x440;</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Опции"><span class="toc-text"><a href="#&#x41E;&#x43F;&#x446;&#x438;&#x438;" class="headerlink" title="&#x41E;&#x43F;&#x446;&#x438;&#x438;"></a>&#x41E;&#x43F;&#x446;&#x438;&#x438;</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#usage"><span class="toc-text"><a href="#usage" class="headerlink" title="usage"></a>usage</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#arguments"><span class="toc-text"><a href="#arguments" class="headerlink" title="arguments"></a>arguments</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#options"><span class="toc-text"><a href="#options" class="headerlink" title="options"></a>options</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#desc"><span class="toc-text"><a href="#desc" class="headerlink" title="desc"></a>desc</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Пример"><span class="toc-text"><a href="#&#x41F;&#x440;&#x438;&#x43C;&#x435;&#x440;" class="headerlink" title="&#x41F;&#x440;&#x438;&#x43C;&#x435;&#x440;"></a>&#x41F;&#x440;&#x438;&#x43C;&#x435;&#x440;</span></a></li></ol>
              <a href="#" id="article-toc-top">Наверх</a>
            </div>
          </aside>
        </div>
      </article>
      <aside id="sidebar" role="navigation">
  <div class="inner">
    <strong class="sidebar-title">Ядро</strong><a href="index.html" class="sidebar-link">Обзор</a><a href="events.html" class="sidebar-link">События</a><a href="locals.html" class="sidebar-link">Переменные</a><a href="router.html" class="sidebar-link">Маршруты</a><a href="box.html" class="sidebar-link">Модуль</a><a href="rendering.html" class="sidebar-link">Рендеринг</a><a href="posts.html" class="sidebar-link">Посты</a><a href="scaffolds.html" class="sidebar-link">Заготовки</a><a href="themes.html" class="sidebar-link">Темы</a><strong class="sidebar-title">Расширения</strong><a href="console.html" class="sidebar-link current">Консоль</a><a href="deployer.html" class="sidebar-link">Инструмент размещения</a><a href="filter.html" class="sidebar-link">Фильтр</a><a href="generator.html" class="sidebar-link">Генератор</a><a href="helper.html" class="sidebar-link">Помошник</a><a href="migrator.html" class="sidebar-link">Мигратор</a><a href="processor.html" class="sidebar-link">Обработчик</a><a href="renderer.html" class="sidebar-link">Рендер</a><a href="tag.html" class="sidebar-link">Тэг</a>
  </div>
</aside>
    </div>
  </div>
</div>

    <footer id="footer" class="wrapper">
  <div class="inner">
    <div id="footer-copyright">
      &copy; 2017 <a href="https://github.com/hexojs/hexo/graphs/contributors" target="_blank">Hexo</a><br>
      Documentation licensed under <a href="http://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0</a>.
    </div>
    <div id="footer-links">
      <a href="https://twitter.com/hexojs" class="footer-link" target="_blank"><i class="fa fa-twitter"></i></a>
      <a href="https://github.com/hexojs/hexo" class="footer-link" target="_blank"><i class="fa fa-github-alt"></i></a>
    </div>
  </div>
</footer>

  </div>
  <div id="mobile-nav-dimmer"></div>
  <nav id="mobile-nav">
  <div id="mobile-nav-inner">
    <ul id="mobile-nav-list">
      <a href="/ru/docs/" class="mobile-nav-link">Docs</a><a href="/ru/api/" class="mobile-nav-link">API</a><a href="/news/" class="mobile-nav-link">Новости</a><a href="/plugins/" class="mobile-nav-link">Плагины</a><a href="/themes/" class="mobile-nav-link">Темы</a>
      <li class="mobile-nav-item">
        <a href="https://github.com/hexojs/hexo" class="mobile-nav-link" rel="external" target="_blank">GitHub</a>
      </li>
    </ul>
    
      <strong class="mobile-nav-title">Ядро</strong><a href="index.html" class="mobile-nav-link">Обзор</a><a href="events.html" class="mobile-nav-link">События</a><a href="locals.html" class="mobile-nav-link">Переменные</a><a href="router.html" class="mobile-nav-link">Маршруты</a><a href="box.html" class="mobile-nav-link">Модуль</a><a href="rendering.html" class="mobile-nav-link">Рендеринг</a><a href="posts.html" class="mobile-nav-link">Посты</a><a href="scaffolds.html" class="mobile-nav-link">Заготовки</a><a href="themes.html" class="mobile-nav-link">Темы</a><strong class="mobile-nav-title">Расширения</strong><a href="console.html" class="mobile-nav-link current">Консоль</a><a href="deployer.html" class="mobile-nav-link">Инструмент размещения</a><a href="filter.html" class="mobile-nav-link">Фильтр</a><a href="generator.html" class="mobile-nav-link">Генератор</a><a href="helper.html" class="mobile-nav-link">Помошник</a><a href="migrator.html" class="mobile-nav-link">Мигратор</a><a href="processor.html" class="mobile-nav-link">Обработчик</a><a href="renderer.html" class="mobile-nav-link">Рендер</a><a href="tag.html" class="mobile-nav-link">Тэг</a>
    
  </div>
  <div id="mobile-lang-select-wrap">
    <span id="mobile-lang-select-label"><i class="fa fa-globe"></i><span>Русский</span></span>
    <select id="mobile-lang-select" data-canonical="api/console.html">
      
        <option value="en">English</option>
      
        <option value="zh-tw">正體中文</option>
      
        <option value="zh-cn">简体中文</option>
      
        <option value="ru" selected>Русский</option>
      
        <option value="ko">한국어</option>
      
    </select>
  </div>
</nav>
  <!-- Scripts -->
<!-- build:js build/js/main.js -->
<script src="/js/lang_select.js"></script>
<script src="/js/toc.js"></script>
<script src="/js/mobile_nav.js"></script>
<!-- endbuild -->

<!-- Algolia -->


</body>
</html>